package com.soulmate.user;

import org.springframework.http.ResponseEntity;

import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.*;

/**
 * @author huaiping
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @GetMapping("/info")
    public ResponseEntity<Object> info() {
        SecurityContext context = SecurityContextHolder.getContext();
        return ResponseEntity.ok(context.getAuthentication());
    }

}
